home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
tangosources.lha
/
bobs_sources
/
bob.s
Wrap
Text File
|
2008-06-03
|
7KB
|
274 lines
*****************************************************************************
* MINI 'NEW-GROUP' XENTRIX ARE LAUNCHED INTRO *
* *
* CODE: BY TANGO/XENTRIX *
* STARTED: 9/2/91 *
* FINISHED: 9/2/91 *
* *
*****************************************************************************
section ste,code_c
incdir df1:
opt c-
include gamemacros
*****************************************************************************
* KILL O/S AND SET UP COPPER ETC... *
*****************************************************************************
killsys
move.l #$70000,a0
move.l #10240,d2
cloop:
clr.l (a0)+
dbf d2,cloop
move.l #$60000,a0
move.l #10240,d2
dloop:
clr.l (a0)+
dbf d2,dloop
lea custom,a5
move.l #newcop,$dff080
move.w #$8640,$dff096
mouse:
move.l vposr(a5),d0
and.l #$1ff00,d0
cmp.l #$00100,d0
bne.s mouse
; move.w #$fff,$dff180
bsr dbuff
bsr clear_bobs
bsr move_bobs
move.w #$000,$dff180
btst #6,$bfe001
bne.s mouse
ressys
clr.l d0
rts
*****************************************************************************
* BLIT BOB ON *
*****************************************************************************
blit_bob:
lea bltapth(a5),a3 ; Faster addressing modes
lea bltbpth(a5),a4
lea bltdpth(a5),a6
move.w #36,d7
move.w #-2,d3
move.w #48<<6!2,d4
move.l bob_y(pc),d0 ; get ship y-pos in d0
move.l bob_x(pc),d1 ; get ship x-pos in d1
move.l screen_base(pc),a0 ; screen addr.
lea bobs(pc),a1 ; bob gfx
lea bobmask(pc),a2 ; bob mask gfx
move.w #$0fca,d6 ; minterm for cookie cut
ror.l #4,d1 ; divide x-pos by 16
add.w d1,d1 ; times by 2 (keep in words!)
add.w d1,d0 ; add x-pos to y-pos
add.l d0,a0 ; add to screen addr.
swap d1 ; swap hi and lo words
or.w d1,d6 ; 'OR' with minterm (get shift value)
blitwait
move.w d3,bltamod(a5) ; modulo =-2 (using RAW BLIT)
move.w d3,bltbmod(a5) ; modulo =-2 (using RAW BLIT)
move.w d7,bltcmod(a5)
move.w d7,bltdmod(a5)
move.l a0,bltcpth(a5) ; screen addr. in Source C
move.l a0,(a6) ; bltdpth Screen addr. in Dest D
move.l a1,(a4) ; bltbpth Ship gfx addr. in Source B
move.l a2,(a3) ; bltapth Ship mask gfx addr. in Source A
move.w #$ffff,bltafwm(a5)
move.w #$0000,bltalwm(a5)
move.w d6,bltcon0(a5) ; Shift value
move.w d1,bltcon1(a5) ; Shift value for mask
move.w d4,bltsize(a5) ; Go to work !
rts
*****************************************************************************
* MOVE THE BOBS *
*****************************************************************************
move_bobs:
lea ysintab(pc),a1 ; point to y-sine table
lea xsintab(pc),a2 ; point to x-sine table
move.l frmptr(pc),a0 ; pointer to formation
move.w (a0)+,d7 ; no. of bobs to plot
bob_loop:
move.w (a0)+,d1 ; x-pos
move.w (a0)+,d0 ; y-pos
move.w (a0)+,d5 ; x-increment
move.w (a0)+,d6 ; y-increment
add.w d0,d0 ; to even words
add.w d1,d1 ; to even words
and.w #$fe,d0
and.w #$fe,d1
move.w (a1,d0),bob_y+2 ; got y-pos relevant to sine table
move.w (a2,d1),bob_x+2 ; got x-pos relevant to sine table
save_all
bsr blit_bob
return_all
add.w d5,-8(a0) ; add to x-pos
add.w d6,-6(a0) ; add to y-pos
dbf d7,bob_loop
rts
*****************************************************************************
* DOUBLE BUFFER THE SCREEN *
*****************************************************************************
dbuff:
not.b buffer ; logical not
tst.b buffer ; test which screen
bne.s other ; if not, then flip
move.l #$60000,screen_base ; point screen to $60000
move.w #$0006,a1h+2 ; set up bitmaps
move.w #$0006,a2h+2
move.w #$0006,a3h+2
rts
other:
move.l #$70000,screen_base ; point screen to $70000
move.w #$0007,a1h+2 ; set up bitmaps
move.w #$0007,a2h+2
move.w #$0007,a3h+2
rts
clear_bobs:
move.l screen_base(pc),a0
blitwait
move.w #$0000,bltdmod(a5)
move.l #-1,bltafwm(a5)
move.l #$01000000,bltcon0(a5)
move.l a0,bltdpth(a5)
move.w #216*64+60,bltsize(a5)
rts
*****************************************************************************
* INTRO COPPER LIST *
*****************************************************************************
newcop:
cmove bpl1mod,80
cmove bpl2mod,80
cmove bplcon0,$3200
cmove diwstrt,$2c81
cmove diwstop,$2cc1
cmove ddfstrt,$38
cmove ddfstop,$d0
a1h cmove bpl1pth,$0007
cmove bpl1ptl,$0000
a2h cmove bpl2pth,$0007
cmove bpl2ptl,$0028
a3h cmove bpl3pth,$0007
cmove bpl3ptl,$0050
dc.w $0180,$0000,$0182,$0eee,$0184,$0555,$0186,$0666
dc.w $0188,$08aa,$018a,$0499,$018c,$03bb,$018e,$00dd
end_copper
*****************************************************************************
* INTRO VARIABLES *
*****************************************************************************
screen_base:
dc.l $70000
bob_y:
dc.l 20
bob_x:
dc.l 20
frmptr:
dc.l form1
buffer:
dc.b 0
even
*****************************************************************************
* BOB FORMATION DATA *
*****************************************************************************
form1:
dc.w 30-1
x set 0
y set 0
rept 30
dc.w x,y
dc.w 1,1
x set x+20
y set y-40
endr
even
*****************************************************************************
* X,Y SINETABLES FOR BOBS *
*****************************************************************************
ysintab:
rept 2
dc.w 200*120,200*120,200*120,199*120,198*120,197*120,196*120,194*120
dc.w 192*120,190*120,188*120,186*120,183*120,180*120,177*120,174*120
dc.w 171*120,167*120,163*120,160*120,156*120,151*120,147*120,143*120
dc.w 138*120,134*120,129*120,124*120,120*120,115*120,110*120,105*120
dc.w 100*120,95*120,90*120,85*120,80*120,76*120,71*120,66*120
dc.w 62*120,57*120,53*120,49*120,44*120,40*120,37*120,33*120
dc.w 29*120,26*120,23*120,20*120,17*120,14*120,12*120,10*120
dc.w 8*120,6*120,4*120,3*120,2*120,1*120,0*120,0*120
dc.w 0*120,0*120,0*120,1*120,2*120,3*120,4*120,6*120
dc.w 8*120,10*120,12*120,14*120,17*120,20*120,23*120,26*120
dc.w 29*120,33*120,37*120,40*120,44*120,49*120,53*120,57*120
dc.w 62*120,66*120,71*120,76*120,80*120,85*120,90*120,95*120
dc.w 100*120,105*120,110*120,115*120,120*120,124*120,129*120,134*120
dc.w 138*120,143*120,147*120,151*120,156*120,160*120,163*120,167*120
dc.w 171*120,174*120,177*120,180*120,183*120,186*120,188*120,190*120
dc.w 192*120,194*120,196*120,197*120,198*120,199*120,200*120,200*120
endr
even
xsintab:
rept 2
dc.w 280,280,279,278,277,276,274,272
dc.w 269,267,263,260,256,252,248,244
dc.w 239,234,229,223,218,212,206,200
dc.w 194,187,181,174,167,161,154,147
dc.w 140,133,126,119,113,106,99,93
dc.w 86,80,74,68,62,57,51,46
dc.w 41,36,32,28,24,20,17,13
dc.w 11,8,6,4,3,2,1,0
dc.w 0,0,1,2,3,4,6,8
dc.w 11,13,17,20,24,28,32,36
dc.w 41,46,51,57,62,68,74,80
dc.w 86,93,99,106,113,119,126,133
dc.w 140,147,154,161,167,174,181,187
dc.w 194,200,206,212,218,223,229,234
dc.w 239,244,248,252,256,260,263,267
dc.w 269,272,274,276,277,278,279,280
endr
even
*****************************************************************************
* BINARY FILES *
*****************************************************************************
bobs:
incbin gfx/ball.bin
bobmask:
incbin gfx/ballmask
even